<#import "/spring.ftl" as spring />

<#include "/tags/userNotification.ftl">
<#include "/tags/userCompleteness.ftl">
<#include "/tags/userIntroTag.ftl">
<#include "/tags/friendList.ftl">
<#include "/tags/friendHintTag.ftl">
<#include "/tags/confirmBox.ftl">
<#include "/tags/activitiesTag.ftl">
<#include "/tags/wallActivitiesTag.ftl">
<#include "/tags/topGoalsTag.ftl">
<#include "/tags/tabTag.ftl">
<#include "/tags/publicProfileHeader.ftl">
<#include "/tags/publicInformationBoxTag.ftl">
<#include "/tags/mutualFriendsTag.ftl">

<head>
	<title>iGoal</title>
	<link rel="stylesheet" type="text/css" href="${rc.contextPath}/styles/style_dev.css">
	<link rel="stylesheet" type="text/css" href="${rc.contextPath}/styles/jquery.alertbox.css">
	<script type="text/javascript" src="${rc.contextPath}/scripts/jquery.easing.1.3.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/jquery.alertbox.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/page.wall.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/dwr/interface/WallPostManager.js"></script>
</head>

<#if data.userInSession == data.wallOwner>
	<#assign myWall = true />
<#else>
	<#assign myWall = false />
</#if>

<#if myWall>
	<@userNotification />
<#else>
	<@publicProfileHeader data.userModel />  
</#if>
<div class="w3"></div>

<div id="infomation">
	<div id="left">
		<#if data.wallOwnerName?? && data.wallOwnerName?has_content>
			<#assign name= data.wallOwnerName/>
		<#else>
			<#assign name= data.wallOwner/>
		</#if>
		<@tab viewer=data.userInSession pageOwner=data.wallOwner pageOwnerName=name page="WALL" />
        <div class="clearthis"></div>
        <div class="dashboardBlueBox blueBoxWall">
        	<span class="bgPos mascotWall"></span>
            <div class="wallPost">
            	<span class="bgPos wallPostForm">
            		<#if myWall>
            			<#assign defaultPost = "Chia sẻ trạng thái..." />
            		<#else>
            			<#assign defaultPost = "Viết lên tường..." />
            		</#if>
                	<textarea id="my_thought" cols="10" rows="10" rel="${defaultPost}">${defaultPost}</textarea>
                </span>
                <div class="clearthis"></div>
                <div class="statusPrivacy" style="display:none;">
                    <#if myWall>
                		<label>Giới hạn người xem trạng thái của bạn:</label><b id="privacy" class="fl">Tất cả</b>
                    	<a href="javascript:changePrivacy();" class="dropIconWall bgPos"></a>
                    </#if>
                    <a href="javascript:saveThought('${data.wallOwner}');" class="bgPos btnShareMyStatus"></a>
                </div>
            </div>
        </div>
        <div class="clearthis"></div>
        <div class="contentHeader">
        	<#if myWall>
    			<span class="icon_1 iconYSD"></span><h1>HOẠT ĐỘNG GẦN ĐÂY CỦA <b>BẠN</b></h1>
    		<#else>
    			<span class="icon_1 iconYSD"></span><h1>HOẠT ĐỘNG GẦN ĐÂY CỦA <b style="text-transform: uppercase;">${data.wallOwner}</b></h1>
    		</#if>
            <span class="fr"></span>
         </div>   
         
		<div class="wallContainer">
			<div id="thought_template" class="wallActivity" style="display:none;">
		    	<a href="${data.userInSession}" class="wallUserAvatar"><img width="50" src="${data.userAvatar}"></a>
		        <div class="wallActivityContainer">
		        	<div class="wallActivityContent">
				        <p>
				        	<a href="/${data.userInSession}" class="user">${data.userAlias}</a> @thought@
				        	<a class="postDelete" rel="POST_@id@"></a>
				        </p>
				        <p class="timeLikeComment onWall">Vừa cập nhật
			        		<span class="like"><a href="#" rel="USER_THOUGHT__@id@"> &bull; Thích</a></span>
				        	<span style="display: none;" class="unlike"><a href="#" rel="USER_THOUGHT__@id@"> &bull; Bỏ thích</a></span>
			        		<a class="show_comment_box" href="#"> &bull; Ý kiến</a>
			        	</p>
			        	<p class="likeListUser" style="display:none;"><a href="#" class="entryLikeThisHover"></a> <span class="like_list">Bạn</span> thích điều này.</p>
				    </div>
			    	<div id="comment">
			        	<div rel="USER_THOUGHT@id@" class="comment_list USER_THOUGHT@id@">
				        </div>
						<div rel="USER_THOUGHT@id@" style="display: none;" class="commentbox">
							<div rel="@id@" class="box USER_THOUGHT">
					        	<textarea onfocus="if(this.value == 'Viết trả lời...'){this.value=''}" onblur="if(this.value == ''){this.value='Viết trả lời...';; hideSendButton();}" class="elastic commentInput">Viết trả lời...</textarea>
								<div class="clearthis"></div>
					        	<input type="button" value="Gửi" style="display: none;" class="commentButton" rel="USER_THOUGHT">				
					     	</div>
				    	</div>
				    </div>
		        </div>
		    </div>
		    <#if data.wallActivities?? && data.wallActivities?size==0>
            	<p class="haveNoActivities infoMessage messageBox">Hiện tại bạn chưa có bất cứ hoạt động nào. Hãy tham gia iGoal, chia sẻ mục tiêu và kết nối bạn bè.</p>
            </#if>
            <#if data.wallActivities??>
            	<@wall data.wallActivities data.wallOwner />
            </#if>

            <div id="scroll_loader" style="display: none; width: 100%; float: left; padding-top: 30px;">
				<center>
					<img src="/images/loader.gif"/>
				</center>
			</div>
        </div>
    </div> 
    <!--end Left-->
    
    <div id="right">
    	<#if myWall>
			<@userCompleteness />		
			<@topGoals />
			<@userIntro />
	        <@friendList username="${data.userInSession}" />
	        <@friendHint />
			<div class="clearthis"></div>
			<a href="http://igoal.vn/goal/view/335" >
				<img src="http://igoal.vn/photos/banner_baohanhtreem.png" style="margin-top:10px"/>
			</a>
		<#else>
			<@publicInformationBox data.userModel />
			<@userIntro allowChange="no"/>
	        <@mutualFriends />
	        <@friendList username="${data.wallOwner}" />
		</#if>
		
	</div>
</div>
